Fix bug that could cause the cursor to be positioned immediately to the left of the widget (within its margin) making it look like there was a space character in the buffer when there was not. Add tests for math blocks. Fixes #21.