added Twirl support and made a bunch of changes that should make things
more consistent