Ensuring local module names are unique in emit.

Fixes #41 and #42.
Also fixes some errant ANSI characters that snuck into scanner.ts and checker.ts.