major refactoring

* namespace refactoring
* server interface changes
* fixed all php codesniffer errors