bug fixes: async, markup, Poltergeist (plus methods for checking state)

See the respective commits. Sorry these aren't all separate pull requests; I just had to get this all working for my project, so it's all in one branch.