Add some simple type stability tests based on `Test.@inferred` and `Base.return_types` for performance critical functions.