base: PEP8 and PEP257 clean-up in factory

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
base: fix for wsgi PATH_INFO handling

* Addresses issue with url encoded arguments in Flask routes. E.g. for
  route `/collection/<name>` the view argument `name` was not unescaped
  when accessed by `/collection/Books%20%26%20Reports` on Apache and
  this led to error during lookup in database.  (closes #1823)

Reported-by: Petr Broz <petr.broz@gmail.com>
Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
search: fix browse pagination links

* Addresses issue with browsing results using next/prev links without
  field name.  (closes #1824)

Co-authored-by: Petr Broz <petr.broz@gmail.com>
Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>