Move TimeUnit to its own file, fix a few minor details.