inlude standard headers in internal/common.hpp
remove normalizing constant class
replace some loops with algorithms