Lazily add mixins

This lazilly adds mixins, providing there are no dynamic mixin calls.  If there are dynamic mixin calls we cannot determine whether a mixin is needed or not, so we must include all of them.