Introduced transform matrices and functions, changed <Contour> points to appropriate data types, organized comments and some docstrings