implement scheduler for blocks, start making it fair.

also make ModuleApplicationAgent less static.