Various changes

Refactored test directory;
Added test;
Refactored parser.js