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.
Actually, this is happening because of markdown parser.

```
+ root (type 0, data 0) - `` 
  + header (type 4, data 1) - `/1
` 
  + header (type 4, data 1) - `GET
` 
  + paragraph (type 7, data 0) - `p1
` 
  + header (type 4, data 1) - `POST
` 
  + paragraph (type 7, data 0) - `p2
` 
```