suggestion #39 and bug #97

- fixes implementation of suggestion #39 : "factor" now tries to get the sign right for each factor no matter what the base ring is (ZZ, QQ, ZZ/n, GF()).

- minimal fix for bug #97: "kernel" tests if target ring is {0}, in which case kernel is whole of source.
this might need to be improved (are there other instances where functions are [understandably] unhappy with a ring being {0}?), but seems to work.