Add STATUS_CODES to response.js.

A collection of all the standard HTTP response status codes, and the short
description of each. For example, `http.STATUS_CODES[404] === 'Not Found'`.
The code is taken from node.js.
Add ScriptableResponse.

ScriptableResponse will be used JavaScript code to create a HTTP response.
Currently, it only takes a String argument. Other arguments such as HTTP status
code will be added later. The status code is hardcoded to 200 for now.
Change the default messsage of main.js to "Hello World".

Currently, an empty string is returned. This is confusing because it shows
nothing on the page.
Support asynchronous response generating with Future.

This patch checks if the return type of handler function is Future and
processes if appropriately.
Refactor ScriptableRequest.

- Remove unnecessary type parameter from ScriptableRequest.
- Move the constructor of ScriptableRequest to the companion object.
This is the style used by other Scriptable classes.
Handle map.get(key) properly.

map.get(key) returns an Option value so it can't be null.
Convert ScriptableRequest.getHeaders to ScriptableMap.

This makes it easy to access headers in JavaScript code. Currently, it does not
support hasOwnProperty(). Need to investigate why.
Add bodyAsText getter to ScriptableRequest.

bodyAsText returns the body as text if the content-type is "text/plain".
Otherwise, it returns an empty string.

Change Request[_] to Request[AnyContent] because we use only AnyContent for
now.
Add bodyAsFormUrlEncoded getter to ScriptableRequest.

bodyAsFormUrlEncoded returns the body as a map if the content-type is
"application/form-url-encoded". Otherwise, it returns an empty map.
Add a factory function create a Response from a JavaScript object.

response.create() converts the given object into a string using JSON.stringify.
Add contentType getter to ScriptableRequest.

Returns the value of the Content-Type header (without the parameters (eg
charset)).
Add bodyAsJsonString getter to ScriptableRequest.

bodyAsJsonString returns the JSON body as a string if the content-type is
either "text/json" or "application/json".
Add secure getter to ScriptableRequest.

secure is true if the client is using SSL.
Convert between BSONValue and JavaScript value with field information.

Currently, ScriptableCollection doesn't consider field type when saving
the data. It causes type error on reading even the data is convertable
to required type.

This patch makes ScriptableCollection convert the data to BSONValue with
Field.
Support Date type on DB API.

Currently, there is a bug so Date type is not saved.
This patch fixes the bug and add example of saving Date.
Convert to requested type when read document from database.

Currently, ScirptableDocument reads data only if the saved data's type
is exactly same as the specified type in schema.
This patch makes ScriptableDocument convert the data with Rhino engine
if available.