adding the pimple library for imminent use
removed constant checks in 'class.' files
replaced db functions with db object