support for type rules

and a bunch of output files