[value] move value functions that depend on angel / main implementations into separate file, included in the other implementations

this fixes building with --no-undefined. also link with libm in cmake.