Added algebra class and tests.