Complete re-write of _hstoreToPhpHelper (used by hstoreToPhp)