replaced NSNumber-specific check with cleaner polymorphic call to [val urlEncodedString]
isValueAcceptable is now a plain function with a static array of class objects to avoid excessive allocations for each check