IntermediateCode: add file header
IntermediateCode: document some functions; inline some TODOs