Small rafactoring.
Remove non-ASCI character from Python comment.
Get stylesheet extension from template file if present. Fix #175.

Plus add some tests.