Started refactoring min.php, removed old code from backup.php, etc

!Attention some callbacks of js function is broken. Need fixing