Add licensing management. Fixes #1