Assigned licences - backend

Main changes:

added quantity of assigned licences to (user|asset),
refactoring.
@quamilek @xliiv please review.
http://media.giphy.com/media/kPMwTWvKadCG4/giphy.gif 
:)