move helper functions to helper methods, python2.6 compatibility
Fixed handling types defined as positional but used as kwargs.

Also specified that types specified as kwargs have higher precedence
than types specified as positional, and that it is ok to give extra
types. Both of these could be considered errors too, but checking
these conditions could only be done on runtime. Don't think that's
worth the effort and small performance penalty.
Always use argument name, not index, in errors