Quick restructuring of files

@imlucas 
Structure the files in a more conventional manner. 
1. put all the code in ./lib
2. decomposed the former long schema.js as a group of several files
3. rename helper files to helpers.js
4. some minor changes