Add env_trampoline, add more test, fix compiling on latest core