libraries: more refactoring fun; full UI for permissions handling; repainting from cache
should be ready for stable
libraries: removed unused and deprecated function