Refactor into simulation.rs/scene/util modules