Minor change in exception raising in factor divide and adds tests for many functions