Refactor boid_editor.js