Refactoring of closure conversion

Refactored the CC code to remove dead code, add comments, etc