replace joda time with java time
added tests and fixes