Makefile functions added, tests added, CMakeLists updated