Fixed tabs/spaces
Refactored type inferer to use middleware
Merge branch 'refactor/type-middleware'
Cleans up type inferer and uses middleware