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.