Lots of fixes/updates for php 5.4, adding visiblity to class methods/properties, adding static keyword where missing, fixing call time pass by reference