byteops: Improve implementation of pow_and_mod() function

This improves implementation of pow_and_mod() function to
be *much* faster.

Signed-off-by: Michal Novotny <mignov@gmail.com>