Restructured to build archive and moved tests into test executable.