Beginning of sinatra-based rewrite.