Use Sinatra::Namespace.

and move helper function.
Merge pull request #195 from hrysd/namespace

Use Sinatra::Namespace.