Some project restructuring

- Moved ./formats.js -> ./lib
- Renamed source/ directory to resource/
- 'npm run tdd' stops on first error
Added 'npm run jsdoc' to generate JSDoc