added nested prioritisation, so for eg Optional('mystring') will match a dict key before Optional(basestring)