add initial support for time queries #53 + tidy up layout #29