Added pull method to Collection

Added a pull method to the Collection class that, when given a key, returns the value from the collection and removed it. This works much like the pull method in the cache repository does. Adding the request for 4.1 as it shouldn't have any breaking changes and should easily merge into 4.2 in the future.

Based on the proposal by @luukholleman at #4450