Refactored mathematical functions into their own file
All mathematical, group, and encryption functions working