Support specifying paths starting with ~/ for layout and partial views

Fixes #821