Add util.format API.

util.format supports the same format as node.js.
The callback function of replace is copied from node.js.
See https://github.com/joyent/node/blob/master/lib/util.js

This patch also adds plugins/lib to the plugins path.
Add console library.

console has five methods for logging: log, info, warn, debug and error.

In Rhino, these methods must be implemented with variable length arguments. But
this is not possible in Scala because Scala implements variable length
arguments with Seq which is not compatible with Rhino.

To circumvent this limitation, changed console to pass a string after
performing format conversion in JavaScript.
Add event.track API.

This API is for logging game events in JavaScript.
The first argument is tag, and the remaining arguments are messages.

Messages are logged in one of the four form:
 - Object -> message itself.
 - Non-object message -> { "message": message }
 - Multiple messages -> { "message": [ message1, message2, ... ] }
 - No messages or message are null or undefined -> {} (empty object)
Make GameEvent print tag name.