Reimplemented InputGenerator as a Behaviour.

This doesn't really change anything, but just moves it off into a namespace with other utilities so that we can keep the main namespace tidier.