Fixed tutorial view and reimplemented API for new frontend
diff --git a/templates/partial/header.html.ep b/templates/partial/header.html.ep
index 02e660e..2bd2c12 100644
--- a/templates/partial/header.html.ep
+++ b/templates/partial/header.html.ep
@@ -1,34 +1,41 @@
 <header>
-  <a href="/" class="logo" title="<%= title %>"><h1><span><%= title %></span></h1></a>
+  <a href="/"
+     class="logo"
+     title="<%= title %>"><h1><span><%= title %></span></h1></a>
+<!--
   <div class="button top">
-    <a href="#" class="login" title="<%= loc 'login' %>"><span><%= loc 'login' %></span></a>
+    <a href="#"
+       class="login"
+       title="<%= loc 'login' %>"><span><%= loc 'login' %></span></a>
   </div>
-  <form autocomplete="off" action="/kalamar">
+-->
+  <form autocomplete="off" action="<%= url_for 'index' %>">
     <div id="searchbar">
-      <input placeholder="<%= loc 'searchplaceholder' %>" name="q" id="q-field" autofocus="autofocus" type="search" />
+      %= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => loc('searchplaceholder')
       <button type="submit" title="<%= loc 'go' %>"><span><%= loc 'go' %></span></button>
     </div>
+    <!-- Search in the following virtual collection -->
+    <!--
     <div id="vc-view"></div>
     <%= loc 'in' %> <input type="hidden" id="vc-name" name="vc-name" value="Wikipedia" />
     <input type="text" name="vc" id="vc" value="corpusID = Wikipedia" />
-    <%= loc 'with' %> <span class="select">
-      <select name="ql" id="ql-field">
-	<option value="poliqarp">Poliqarp</option>
-	<option value="cosmas2">Cosmas II</option>
-	<option value="annis">Annis</option>
-	<option value="cql">CQL v1.2</option>
-      </select>
+    -->
+    <%= loc 'with' %>
+    <span class="select">
+      %= select_field 'ql', [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field'
     </span>
     <div class="button right">
       % param(cutoff => 1) unless param 'q';
       %= check_box cutoff => 1, id => 'q-cutoff-field', class => 'checkbox'
       <label for="q-cutoff-field"><span></span><%= loc('glimpse') %></label>
+<!--
       % unless (current_route 'tutorial') {
       <a href="/doc/faq"
 	 title="<%= loc 'faq' %>"
 	 class="question"
 	 id="view-faq"><span><%= loc 'faq' %></span></a>
       % };
+-->
       <a href="/doc"
 	 title="<%= loc 'tutorial' %>"
 	 class="tutorial"