Fix typo.
Move some type declarations to modules.
Make this example can run with cowboy 0.9.0.
Update examples with new style coding.