Fixes for #637, making theory parameters assignment more consistent across sources

There's a few inconsistencies in theory implementation, as discussed in #637. This shouldn't make any differences to reasonable normal usage, just to some edge cases.

Essential changes:

 * Datapoint matches for all field datapoints and multi-valued method datapoints (i.e. not single-valued method datapoints) are done on runtime type, not the field/method return type (previously this was the case for multi-valued array methods only)

 * All datapoint type matches now correctly handle boxing and unboxing for primitive and wrapper types; int values will be considered for theory parameters that are Integer assignable, and Integer values will be considered for int parameters)

(#637 has examples and more details on this)

This conflicts with my other open pull request (#639), but given that we want to make the behaviour in that case more complicated, I think it would be better to fix these inconsistencies first, and then continue that on top. This is also most of the setup work for a fix I have going for #110/#126, as we have to pull types at runtime for iterables there anyway (since the generic type info isn't reliably available).