Added variable filtering and validation

Validation logic was existing but it was reworked to abstract out checking for
required fields initially and then sanity checks after the fact. Filters are
applied before validation but after checking existence. No support for _PUT and
_DELETE at the moment as those do not exist as super globals natively in PHP.