Page is remembered after a reload, some other fixes.

A bug with <pre> was fixed by @djanowski, and the source
code was rearranged.