Fix some problems with inheritance and mixins

This lets a mixin declaration live outside a block (effectively hoisting
such mixins to the very top of the tree.