Move htmlcat() function to common definitions (fixes packaging and build tests), unify location of test-common.sh.