Fix passing of DynArrays to Java constructors (DYNJS-118)

This also fixes issues with passing DynArrays to Java methods
expecting primitive arrays (ie int[], boolean[], etc).

This should be the last change needed to fix DYNJS-118.