Cleanup whitespace and tidy PHP