refactoring and optimizing

massive refactoring and code duplication removal.

optimized PARTY sql query (1300ms -> 700ms) and added caches.

feature: raw mks names by parties (upon users requests)