Refactor Unit into Builder.

Also add some hardcore generic template stuff...