[Work in progress] Some general php5 refactoring

Added psr-0 namespacing; Renamed Classes; Moved some constants to class-constant (for autoloading); Replaced some old php4 code with new code