Open templates files in binary mode.

This fix error invented by previous commit.  Now opened file can be
decoded on any python version.