1) some code cleanups 2) introduced Post class
1) completed add / update function (not tested...) 2) made a new Post class