I've written some code to do various (fairly basic) algebraic things in Java. I'm posting it online in case it is useful to someone.