[minor] Removed misplaced comment.
[minor] Removed a couple `for` comprehensions.
Add a test that actually applies to issue #38.
Add a couple functional helper functions to JS.