Various fixes...

Some changes for handling versions and such; mostly in preparation for
abstracting the templating part a bit.