Fix #1040
Updated tests
Optimizations
Interned strings
Make tests pass
Merge pull request #39 from sjinks/issue-1040

Issue 1040