Fix license issues

Re-opens #43 and fixes some remaining issues.