More overhaul/cleanup of time.rb, with tests now passing