Added rational-compatible abs and pow. Refactored tests.