Added factorial and miscellaneous math functions.