turned terrain into shareable AMD RequireJS module