Fix #516 Create and Register log() function

Create and register log function, supported by couchdb so that the JS map function including log function calls can be run inside CBL Lite without any issues.
Merge pull request #525 from couchbase/feature/issue_516

Fix #516 Create and Register log() function