Quantity of assigned licences

Main changes:
 - added quantity of assigned licences to (user|asset),
 - refactoring.

@quamilek @xliiv please review.