Coap 18

Not sure if this pull request is a good idear. I made the changes based on a more actual contiki.