wrote a bunch of matrix arithmetic code, haven't tested any of it
some routines to compute cycles and boundaries
made a real effort to start reference-counting properly. what a mess