bugfixes
refactor licences

- introduce Licensable interface
- extract common functionality into Licence model
refactor license JavaScript

- remove all global variables
- extract logic into separate file
- misc code restructuring
move ProtectedFeed JS into separate file