Added documentation, moved to lib/