nuke more defines; switch INLINE to inline; use std::numeric_limits