test
Changed pageState from an array to an object

call_user_func in php5 does not allow variables to be passed by
reference. When pageState is an array, call_user_funct needs to pass it
in by reference in order for the functions to modify it. As an object,
the pageState can be modified without call_user_funct passing in the
variable by reference.