Remove unnecessary terraingen stuff and force inline a lot of calls