Extract some constants.
Fix memory leak with static file serving (closes #231).