fixes #16: modularise and clean up src/index.coffee
replace AST literals with esprima.parse + mutations
fixes #20: implement `badRequireError`