Add a factory method to ScriptableFuture.

Add a factory method to remove repetitve ScriptableFuture creation code. This
factory method will be used internally.
Add DB API stubs.

This patch only adds interfaces. Methods will be implemented soon.
Implement Query methods.

This patch implements query methods except for where. See
https://github.com/SollmoStudio/beyond/wiki/Beyond-DB-API-Query for more
information.
Implement Schema constructor.

See https://github.com/SollmoStudio/beyond/wiki/Beyond-DB-API-Schema for
more information.
Implement ScriptableDocument constructor.

This constructor is used internally. Users are not allowed to construct
an instance directly. A user must get a ScriptableDocument from
ScriptableCollection.
Implement ScriptableDocument.objectID.

The objectID is read only property that contains the ObjectId of a document.
Implement ScriptableCollection.insert() method.

Insert method receives a JavaScript object and returns a ScriptableFuture.
Implement ScriptableCollection.find() method.

Find method receives a ScriptableQuery and returns a ScriptableFuture gives
Array[ScriptableDocument].
Implement ScriptableCollection.findOne().

FindOne method receives a ScriptableQuery and returns a ScriptableFuture which
gives ScriptableDocument. This method returns only the first document unlike
find method.
Add getter to ScriptableDocument.
Add some DB API(insert, find and findOne) examples.

This patch adds examples to show how to use DB API.

There are three examples:
 - insert
 - find
 - findOne

To run insert example, send POST to /plugins/insert/{key}/{value}.
This example inserts the key and value to example.keyValue collection.

To run find example, send POST to /plugins/find/{key1}[/{keyN}]
This example finds all the documents whose key is one of keyN.

To run findOne example, send POST to /plugins/findOne/{key1}[/{keyN}]
This example finds the document whose key is one of keyN.
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.