Factored re-typing logic into seperate ReTyper class

Refactored re-typing logic from erasure into seperate ReTyper class. Another candidate
subclass of ReTyper is a future TreeChecker.