Implemented test files for libs. Refactoring.