1.7.10: New permissions and code cleanup

New permission system, general code cleanup and more.

Description will be added shortly.