Refactor out Post class

Started refactoring

new class can take a hash of attributes and return it

incorporated into app and view