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.