updated readme and readme example, some refinement
fixed readme formatting, test-dbg.js
added tests, some refinement & bug fixes
Merge branch 'develop'