CodeCleanups + Bug fix: for when a module with unprocessed data is processed twice

Also cleaned up the code by replacing unsigned longs and ints with
ModuleId
Also typedef unsigned long ModuleId --> typedef size_t ModuleId;
This shuts up a few VisualStudio compiler warnings. :D