Lazy load models in shells

Rebased for 2.4 from the original PR #572 Thanks!