context menu label now can be string or function

added a _getLabel helper function to context menu so context menu labels can be extracted using it. now labels can be either a string or a function.
Also fixed some minor issues tests and added a new test for _getLabel() function.