Added licensing comment to top of file
Changed functions to get value from context, rather than the $_REQUEST super-global