Fixed age and date functions, added unit tests