Cleanup most of the code that uses MySql
Replace different app/depot arrays with a single list and only execute queries when needed
Partially rewrite package processor, and minor cleanup