COOPR-617: Resource versioning

This PR also include changes for https://issues.cask.co/browse/COOPR-195. 
Let's use -1 here to make it easier to understand, and not use 0.