Implemented file deleting feature.

Moved rules to a separate class in preparation to AI implementation.
Preview list menus are still buggy but the software is working.