Added testing; moved some functions to a library