Adding mocha testing framework with tests. Cleaning examples and renaming sync to standard.