Heuristic 5

This implements the fifth heuristic of the Maple Paper. There are two sub-steps. I suppose I have completed both. I've tried to optimise it as much as possible. but still I think speed might be as issue, I've just added a single test that is in given in the Maple Paper. I'm a bit afraid to test it more, because of speed issues. I would like to someone to review this before I add more tests.