BaseMixin utility, indentation fixes

Created a BaseMixin class providing utility functions for model classes. Fixed some weird indentation here and there.