Move post rendering code into post.erb and fix up thread.erb