Moved stuff into lib directory