Changes compiler to use InternalPreconditions class.

Also marks related checking as side-effect free so they could be
fully optimizable based on checking level when we switch to
configurable preconditions.

This will follow up first with a patch that introduces configurable
preconditions. After that I will send a clean-up patch that removes
the logic in compiler for eliminating casts as that will no longer
be needed.

Change-Id: I1edd5b693afc89dc800a4560c41bf95c6a049a03