Block bugfixes

this is dependent on #37 and includes all the changes from that pull request, please review and merge that one first for easier reading.

Original request: https://github.com/wysiwhat/Aloha-Editor/pull/47