Range validation for arrays and array sizes

This is in preparation for length validations and memory pre-allocation.
Version 0.7