extracted a function, wrote a few tests

hi, i'm using your parser for a project and noticed that you had a ["todo"](https://github.com/cparker15/csv-to-json/issues/3) to extract the functionality from the page.  since i need that too, i thought you might like this.  it's not a grunt build or AMD thing, but it's relatively lint-free.  I'm not a javascript expert, would be happy to fiddle with it some more if you like.