Improve C++-ness, eliminate some macros
- fm_exp moved to math_special (exp2 was already there)
- use std::min/max template instead of macros
- use memory->create for dynamic arrays (still 1-indexed with macro)
- remove _ from function names, adjust method visibility