Start of the 2nd step

Fixed memory leaking. Beginning of creating a tree creator and code
analyzer.