[enh] Move the begin/end fields on M2M tables to an abstract model

Add some helper methods on this abstract model and create a custom
manager/QuerySet with methods for common filter operations