fix typo in error message
add some static asserts to guard against memory usage regressions
pull math functions from std namespace
make temporary variables const
add static assertions to SearchEngine