More features!

* Input element states
* Some unit tests
* Minor fixes