Converting Time module to JS.

Do not merge.