Fleshed out AppContext system, added stats.