add mathematical documentation and begin moving analyzer to kernel