allow modules to be cloned in environments, add finish callback to iksolvers, fix bugs with retiming