Fixed typos in CascadedPolygonUnion

binaryUnion needed to cast mid index to an integer.
some functions expected a javascript.util.ArrayList and a js Array was
used.
fixed other variable name typos.

NOTE: This is not my commit, all credit goes to @glenrobertson. I would just like to get this fix pulled.