Improved support for Mojolicious 7.23

Change-Id: I7919a6136ed1e5175a9b26244eea77ab7924f3d8
diff --git a/Changes b/Changes
index 6009d6e..c01d2b7 100755
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
-0.21 2016-12-06
+0.21 2017-02-01
         - Use textSigle for API communication instead of
           {corpus,doc,text}ID.
         - Added alert to hint helper.
@@ -16,6 +16,8 @@
         - Do not show multiple identical annotations
           in table view.
         - Added preliminary support for metadata columns.
+        - Added preliminary support for multimenus.
+        - Updated to more recent version of Mojolicious (7.23).
         
 0.20 2016-05-25
         - Improved menu using sliders.
diff --git a/Makefile.PL b/Makefile.PL
index c715e54..4ad02be 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -14,7 +14,7 @@
   },
   LICENSE      => 'bsd_2',
   PREREQ_PM => {
-    'Mojolicious' => '5.00',
+    'Mojolicious' => '7.23',
     'Mojolicious::Plugin::TagHelpers::Pagination' => 0.06,
     'Mojolicious::Plugin::TagHelpers::MailToChiffre' => 0.09,
     'Mojolicious::Plugin::Notifications' => 0.04,
diff --git a/README.md b/README.md
index 060e0ee..09d2480 100644
--- a/README.md
+++ b/README.md
@@ -118,7 +118,7 @@
 
 ### Original Software
 
-Copyright (C) 2015-2016, [IDS Mannheim](http://www.ids-mannheim.de/)<br>
+Copyright (C) 2015-2017, [IDS Mannheim](http://www.ids-mannheim.de/)<br>
 Author: [Nils Diewald](http://nils-diewald.de/)
 
 Kalamar is developed as part of the [KorAP](http://korap.ids-mannheim.de/)
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 5591cc4..4dfb35d 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -1,6 +1,7 @@
 package Kalamar;
 use Mojo::Base 'Mojolicious';
 use Mojo::ByteStream 'b';
+use Mojo::File;
 use Mojo::JSON 'decode_json';
 
 # Minor version - may be patched from package.json
@@ -19,8 +20,11 @@
 
   # Set version based on package file
   # This may introduce a SemVer patch number
-  my $pkg = b($self->home . '/package.json')->slurp;
-  $Kalamar::VERSION = decode_json($pkg)->{version};
+  my $pkg_path = $self->home->child('package.json');
+  if (-e $pkg_path->to_abs) {
+    my $pkg = $pkg_path->slurp;
+    $Kalamar::VERSION = decode_json($pkg)->{version};
+  };
 
   # Lift maximum template cache
   $self->renderer->cache->max_keys(200);
@@ -34,17 +38,17 @@
       my $c = shift;
       my $host = $c->req->headers->header('X-Forwarded-Host');
       if ($host && $host eq 'korap.ids-mannheim.de') {
-	$c->req->url->base->path('/kalamar/');
-	$c->stash(prefix => '/kalamar');
+        $c->req->url->base->path('/kalamar/');
+        $c->stash(prefix => '/kalamar');
       };
     }) if $self->mode eq 'production';
 
 
   # Set secrets for signed cookies
-  if (-e (my $secret = $self->home . '/kalamar.secret')) {
+  if (-e (my $secret = $self->home->child('kalamar.secret'))) {
 
     # Load file and split lines for multiple secrets
-    $self->secrets([b($secret)->slurp->split("\n")]);
+    $self->secrets([b($secret->slurp)->split("\n")]);
   }
 
   # File not found ...
@@ -94,7 +98,7 @@
 
 
   # Configure documentation navigation
-  my $navi = b($self->home . '/templates/doc/navigation.json')->slurp;
+  my $navi = Mojo::File->new($self->home->child('templates','doc','navigation.json'))->slurp;
   $self->config(navi => decode_json($navi)) if $navi;
 
 
@@ -152,7 +156,7 @@
 
 =head2 COPYRIGHT AND LICENSE
 
-Copyright (C) 2015-2016, L<IDS Mannheim|http://www.ids-mannheim.de/>
+Copyright (C) 2015-2017, L<IDS Mannheim|http://www.ids-mannheim.de/>
 Author: L<Nils Diewald|http://nils-diewald.de/>
 
 Kalamar is developed as part of the L<KorAP|http://korap.ids-mannheim.de/>