* Refactored the type inference code in preparation to make it a public api. * Added type inference tests Fixes #2567