working licence metadata encoding with tests