Reimplemented custom maths library and removed flow-math

Signed-off-by: thehutch <52d5ad14@opayq.com>