first pass at modularizing core
add an example mocha test