(PUP-2860) optimizations and maintenance

This PR contains a series of refactoring, maintenance and small performance enhancements.

The biggest source line changes are caused by a refactoring of the rgen based models splitting
them into a meta model part, and an implementation part. This to later enable faster / different construction
of the meta model and mix in the implementation.

Review is probably best done per commit.
We know that both size_t and size_t2 are both PIntegerType (we only need to be certain that size_t is to avoid a polymorphic call). We do the assignable call to get a range check. (Yes it could be optimized further to avoid an is_a? and constant dereference)