More docs, cleaned up old matrix-heavy code, replaced A*B with numpy.dot(A,B)
Moved some stuff to misc.py for now.