updated phpspec, added new specs, fixing bugs and abstracted rbac