Generalized some ideas from multiply implementation into a template metaprogramming header, and improved multiply implementation further.