Refactor partnership and implement full partnership functions

@houndci @cgruppioni @georgetmayorga