Make scalastyle warn when code exceeds the maximum cyclomatic complexity.

Currently, scalastyle errors when code exceeds the maximum cyclomatic
complexity (currently 10). It's helpful mostly but it makes code verbose in
some cases.
Adjust relations between Scala, JavaScript and BSON types.

Currentlym Scala, JavaScript and BSON types are not consistently used. This
patch adjusts their relations.

There are three kind of types:
 - JavaScript type: used by Rhino engine
 - Scala type: intermediate type used by Scala code
 - BSON type: used by database

The conversion table is:

 JavaScriptType  | ScalaType            | BSONType
-----------------+----------------------+----------------
 NativeObject    | Map[String, AnyRef]  | BSONDocument
 NativeArray     | Seq[AnyRef]          | BSONArray
 NativeNumber    | Int                  | BSONInteger
                 | Long                 | BSONLong
                 | Double               | BSONDouble
 NativeBoolean   | Boolean              | BSONBoolean
 NativeDate      | Date                 | BSONDateTime
 NativeUndefined | Undefined            | BSONUndefined
 NativeFunction  | String               | BSONJavaScript

JavaScript types can be converted to Scala types with Field and Scala types can
be converted to JavaScript types with Context and Scope.  Scala types are
convertible to BSON types and vice versa.  But JavaScript types and BSON types
cannot be converted to each other directly.

ScriptableDocument contains data as BSON Type, and converts to JavaScript type
when the engine requests it.

Scala types seem to be useless because it's not used by engine nor database,
but code becomes complicated without these types because the Rhino engine
automatically converts primitive types with toSource method of Native*.
Add ObjectID wrapper.

Currently, there is no way to find a document with object id.
This patch adds ObjectID wrapper. A user can use this wrapper with
require('db').ObjectID().

This patch also adds examples of how to use ObjectID.
Implement the reference type for DB field.

The purpose of reference field is to reference a document. This field will
store the object id of the document. The getter of a reference type field
returns the future of the document referenced by this field.

And this patch adds three examples of how to use reference type.
Add embedding field.

Embedding field is used to store an object. This type must be used with a
schema.

See https://github.com/SollmoStudio/beyond/wiki/Beyond-DB-API-Schema for
more information.
Make reference field return ObjectID.

Currently, reference field returns Future of document for convenience.
However, only the object id is needed in some use cases. This patch makes
reference fied return ObjectID instead. When a user needs the corresponding
document, the user must call findOne.
Fix a grammar error.
Remove invalid comments.

bodyAsJson is already implemented.
Do not convert to NativeObject if it is a primitive type.

Currently, each field type of Document is always 'object' instead of the
expected type (e.g., 'string', 'number' and 'boolean') because
ScriptableDocument converts it to NativeObject.

This patch makes ScriptableDocument return the primitve type with no
conversion.  Rhino engine will automatically convert Number, Boolean and String
because BeyondContextFactory set javaPrimitiveWrap to false.
Don't share emptyUpdatedValueTable across multiple ScriptableDocument.

Currently, ScriptableDocument's updateValues field accidentally shares a
single UpdatedValueTable because emptyUpdatedValueTable is a singleton defined
in ScriptableDocument's companion object. Move it to ScriptableDocument class
so that each ScriptableDocument instance has its own UpdatedValueTable.

Also move UpdatedValueTable type to ScriptableDocument class because it is used
only within ScriptableDocument class.
Expose objectID as objectId in JavaScript.

Follow the mongo shell's naming convention.