Library functionality

Added functionality and tests to library, demo incoming