lib/js: Refactor to use detective for finding requires

detective provides a much more reliable way to locate `require()`
statements than a regexp.  This now allows us to parse requires
prefixed with `//` that aren't a comment (see duojs/duo#305).

A test demonstrating the issue has been included, as well as some minor
whitespace cleanup in the test file itself.
Add .gitignore
Makefile: install dependencies before running unit tests