Implement common functions to work with date and time types and avoid duplicate code.
Remove unnecessary functions used to retrieve the valie in long integer instances.
Various other fixes and name adjustments.
By not taking the object reference as const we are forced to make copies of objects that are const or use const_cast. Eitherway, this is the correct way because objects are not modified.