Initial implementation of savepoint-based nested transactions.

In dire need of documentation and tests.