some bugfixed in parameter parsing; implemented router module, which controls the program flow