Use .length rather than Array.getLength

Array length queries were taking over 3% of the processing time on my Android build. The .length field is directly used in the Bool cast code so presumably there's no concern with doing so elsewhere.

Edit: Ah. I didn't realise that pull requests were per branch. If you want one change and not the other and can't disentangle the commits then let me know and I'll split them. The second change (and the 3rd fixing the 2nd) is also mostly for Android performance. EndUpdate was taking nearly 2% of the processing time.