Fix headres.

Sort headers by name. Add pragma once to every header.
Ensure timestamps are positive. Reduce sleeping to half of the max interval.