Code cleanup and added phpUnit tests

Basic tests added for date-tools, date-tools converted to a static
class so default date formatting could be included.