Numerous fixes and change class precedence to favor mixins