Moved database IO methods to Transaction and optimizations

DB is no longer sticked to it's parent transaction.
Removed Lazy from MarshalValueStructure.
Added some tests.

Closes #17