Refactor partnership and implement full partnership functions

@houndci @cgruppioni @georgetmayorga
Extra blank line detected.