Get rid of pjax

- the complexity of pjax makes the code error-prone
Modularize layout.html