Refactored the unserialize_php_array function into a class and
abstracted code into helper methods.