converted code from mochiweb to webmachine
Merge branch 'webmachine'