Some logic clean-up. Add a tool to insert module codes into part.cfg