There is a bunch of ~35 commits but do not be scared, they are all small and I wrote them to make them easy to read/review (well, at least it is what I think).
Most of these subroutines were ugly and impacted performances (too many useless fetches from the DB).
This whole stack will be hard to rebase and maintain, so it would be great to get it in soon.
Several things can appear ugly or not perfect, but keep in mind that we are moving, improving and refactoring our code. The test coverage is better and this is just a step before the next one. I really want to start to take care of the very ugly code, but for now we need keep moving.
C4::Members is almost dead and we are going to manipulate Koha::Patrons everywhere, which will ease the readability, maintenance and write of new improvements.
Let me know if you have any questions.
Note that patronflags is not completely removed as I need help to remove it from C4::SIP