Badges system started.

Cleanup of function structure.
Start of badge system - just needs to check against parameters to award
them. More to come.
Updated hats.