Fixed  issue #1776
Minor: fixed warnings and nasty \n on db import
SQL new sql function "document" to create a document at the fly. This is neede by last patch that automatically creates a collection of items when a sub select is executed (smart!)
Incremented JVM heap on tests to 2GB