sim: refactor to generate code for all modules
vars: fix Table to support explicitly specified xpts