Tidied lib exports. Added test coverage