Add basic library

Pull request contatins fully working library and example