Add unit tests

This is a first go at adding unit tests on this module. Would fix issue #2

I took out the parser part so we can test that without actually running in the specific environment.

There is another bug for creating functional tests, that would in fact *run* the module (not only the parser) and see how it reacts.

Missing: windows sample data and parser.

r? @tofumatt
Also I've never seen `+var` in JS. Seems to just coerce it into a `Number` (or `NaN`), why use it here, especially alongside the already type-messing-with `!=`?