Move context module into inference package