Sort scriptable classes array in BeyondGlobal.scala

To avoid conflict in the future.
Use ScriptRuntime to get Array[Byte] in ScriptableCrypto.

A JSArray element can't be casted to Array[Int] directly.
Move the default encoding to BeyondConfiguration.

Encoding would be used quite often in the future, so it'd be
better to have one shared configuration here.
Implement ScriptableBuffer.

ScriptableBuffer is an implementation of `Buffer` class in Rhino.
It basically provides methods to manipulate buffers with String and
Byte. An example code representing the usage of the class is also
added in the `examples` directory in plugins.
Add findOneAndRemove method to DB API.

This method is the same as findOne except it also removes the document.
However, we can't implement findAndRemove because ReactiveMongo driver supports
the command only for one document.
Add orderBy option to find method.

This patch adds orderBy option to find method. Now you can use find
method like below.

collection.find(query, { orderBy : { field1: db.ASC, field2: db.DESC } })

It will return sorted(appling field1 ASC first and appling field2 DESC
in the set that has the same field1) result.

Parsing orderBy option seems too difficult to read, it's because to
ensure backward compatibility.
As before, the second argument will be used as the limit number if it is
the number. And the second argument will be used as find option if it is
the JavaScript object.
If you want to use orderBy and limit option at the same time, this will
be as below.

collection.find(
    query,
    { orderBy: { feild1: db.ASC, field2: db.DESC }, limit: 10 }
)