Create JavaScript API.

Created an API that is better suited to use from JavaScript.

All files have been converted to JavaScript.

Tests are run using Proof 0.0.17.

Closes #17.
Closes #16.
Closes #15.
Closes #14.
Closes #9.
Closes #8.
Closes #6.