Fix parser bug with implied close tags. Add some tests for incremental typing

@dangoor 

Note that I rebased this branch since you looked at it, so you'll need to reset your local branch if you pull it.

This fixes the implied close tag parser bug (for real this time) and adds a couple of tests for incremental typing cases. We could definitely stand to add a few more along these lines, but I thought it would be good to at least get these in.