more math functions; performance improvements with large bigintegers, etc.

Also added multiply test cases