ResourceParser refactor

There is a weird bug with the PayloadParser with the test commented out in test-ResourceParser.cc. Will fix it tomorrow. Please review this in the meanwhile.
It's not that it is not working, I want to move this to ResourceGroupParser.