An Algebraic Approach to Mixins and Modularity