Fix Illegal offset warning in FormTypeParser (closes #147)

This PR fixes the illegal offset warning in FormTypeParser.
I also added unit tests and removed the FormRegistry dependency for easier testing.