General cleanup and PHP standards

General cleanup and PHP standards