JavaScript API - Crypto

#118.

Conflict with other API PRs might occur because of test functions in `main.js`.
It's subtle enough for anybody to cope with it, or I can re-upload the PR.