Added unit tests for option --backup
ixed the test suite
Added test fixtures
Refactored apply_templates()