fixed ``_kahane_simplify``, ``_trace_single_line``
modified ``gamma_trace``; added tests and documentation
faster ``contract_metric``; added ``get_lines``