Element check

This should fix #33. Verified against [dojo2-core](https://github.com/csnover/dojo2-core/) using the existing functional test as well as a modified functional test that can be found [here](https://gist.github.com/bitpshr/edfdc97b1b96927bc160).