Moved some module initialization code from main to the proper modules file.