Add templated functions to alexlib

alexlib.tcc is the home of the definitions of the new templated
functions.

Moved the libraries to "lib/".

SumOfFactors and NumberOfFactors now both call the new function Factors,
so that all the code is contained in only one location.