Tms cleanup

Cleans up some problems with the recent merge of TMS changes.  Mainly a missing module and a few JSHint warnings.  There are no functional changes made.  I noticed we don't have many tests for this yet, but I'll write a separate issue for that so we can address them later.

CC @kring