Setup Posts Class

Made the PHP much easier to read, turned it into Object Oriented rather
than procedural code, it makes more sense now and is much easier to
modify.