Added compat with PHP 5.4 and bumped to 0.5.1

I1e5972ed7a02ad359008820354bb76d25f594225

Change-Id: Iba89d436d318b261fc69dd6217d0e76865fa3624
Bump to 0.5.2 beta

Change-Id: I2d25cd851950fa87b81804d64e0ce9003893e29c