WIP commit: initial implementation of generating tagged filter inputs, plus corrections to the tests where I had mistaken the expected type of a test variable level generated by the testing code. This currently fails at least one test.