Initial implementation of a predict function.
Improve robustness of Chains header formatting.