Templatize newreply/editpost thread reviews. Also add a few things.

lib/layout.php is now all templatized. Yay.