is prime, prime decomposition and totient functions

I made a PR a LOOOONG time ago and completely forgot to add tests, so it was closed - here is that same request with tests!  Apologies for taking months...