Separate out tests and library