cleanup - (i) added 'SourceCodeWriter' object with html buffer & line depth; (ii)split monster function 'write_line_with-links' in half, split the logic for link resolving from generation and emission