moved table and grid to common since thay can be ran locally as well
now reusing a context per thread, clearing user variables after each call