Fixed #4 - Added support for transactions.

Also updated documentation and demonstration code.