Add spec for undo, fix undo with transaction

Do all inserting in a transaction so that a single undo step undoes
entire empty line insertion.
Merge pull request #13 from ilkka/curly-brace-autoindent

Add spec for undo, fix undo with transaction