Javascript examples part 1 Fixes #2

This includes javascript code for the sync examples. The examples are also with a new mocha test file.

Async will be coming