Rewrite Day and WorkPeriod to use LocalDate and LocalTime

Add unit test for WorkPeriod as well.
Cleanup code a bit as well.