Refactor to modularize

- No longer relies on process.args
- Exports functions to test
Add unit tests with jasmine
Add more unit testing

- Added tests to test the card parsing functions