extract smodel module (from kernel); update build scripts
fix build scripts; move ModuleId/ModuleReference -> core/smodel
move more classes into core/smodel