Implemented bag with counted reference pointers

CVUT name: tolmeval