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

Fixes #821
1298 is closed.