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.
What worries me a bit is that we are inconsistent in naming (I am the guilty one here). Some static member methods start with a capital letter others with lowercase. What do you think?