Make compatible with PHP 5.3, update readme, tweak code documentation