Build: Move processing of "modules" option to a task