Refactored PostDB to Post and added a generation function to handle key and time setting | moved template defs to the templates package