Add static methods. Add preconditions for mixins

This PR adds a way to conditionally apply mixins given specific arguments. It does this through static methods, which have also been added.

Fixes #4