big refactor to make the engine more module like, also some pre work for further server side validation