tidy up copypasta
add basic escape function
use latest mocha with promises support
add support for indices
Merge pull request #12 from codemix/add-index-support

Add index support