massive refactor! and added some more tests and support for auto-casting parse results