Declare mixins used by resource on class declaration.

Previously they were dynamically added to the base class, which makes the
code harder to read.