Refactored for more flexibility and more coherent 'API' mixins. Updated readme.