Add unit and integration tests for template loader