Refactor horizon TemplateLoader
Refactor horizon TemplateLoader

Here we can use `with` statement to keep
horizon code clean.

Change-Id: I98ffc3fbcb6892a3739f2de1936c54e868f8908f

agileblaze/OpenStackTwoFactorAuthentication,endorphinl/horizon-fork,promptworks/horizon,redhat-cip/horizon,Hodorable/0602,davidcusatis/horizon,JioCloud/horizon,davidcusatis/horizon,Dark-Hacker/horizon,sandvine/horizon,takeshineshiro/horizon,wolverineav/horizon,wangxiangyu/horizon,Tesora/tesora-horizon,orbitfp7/horizon,henaras/horizon,tanglei528/horizon,openstack/horizon,dan1/horizon-proto,nvoron23/avos,ikargis/horizon_fod,FNST-OpenStack/horizon,noironetworks/horizon,coreycb/horizon,bac/horizon,VaneCloud/horizon,flochaz/horizon,mrunge/horizon_lib,promptworks/horizon,wolverineav/horizon,zouyapeng/horizon,zouyapeng/horizon,tsufiev/horizon,philoniare/horizon,mandeepdhami/horizon,damien-dg/horizon,django-leonardo/horizon,xinwu/horizon,xinwu/horizon,ging/horizon,redhat-cip/horizon,yeming233/horizon,vladryk/horizon,wangxiangyu/horizon,nvoron23/avos,damien-dg/horizon,Tesora/tesora-horizon,damien-dg/horizon,idjaw/horizon,j4/horizon,dan1/horizon-x509,izadorozhna/dashboard_integration_tests,bigswitch/horizon,dan1/horizon-proto,yeming233/horizon,tqtran7/horizon,sandvine/horizon,django-leonardo/horizon,maestro-hybrid-cloud/horizon,icloudrnd/automation_tools,yjxtogo/horizon,liyitest/rr,yanheven/console,redhat-openstack/horizon,NCI-Cloud/horizon,ging/horizon,idjaw/horizon,mdavid/horizon,Metaswitch/horizon,gochist/horizon,vladryk/horizon,FNST-OpenStack/horizon,JioCloud/horizon,wangxiangyu/horizon,j4/horizon,Solinea/horizon,NeCTAR-RC/horizon,gerrive/horizon,NCI-Cloud/horizon,mrunge/horizon,Metaswitch/horizon,VaneCloud/horizon,nvoron23/avos,doug-fish/horizon,doug-fish/horizon,blueboxgroup/horizon,mrunge/openstack_horizon,maestro-hybrid-cloud/horizon,Tesora/tesora-horizon,CiscoSystems/avos,watonyweng/horizon,mandeepdhami/horizon,j4/horizon,CiscoSystems/horizon,bigswitch/horizon,damien-dg/horizon,xme1226/horizon,watonyweng/horizon,BiznetGIO/horizon,pranavtendolkr/horizon,yeming233/horizon,luhanhan/horizon,tsufiev/horizon,bac/horizon,karthik-suresh/horizon,CiscoSystems/horizon,Metaswitch/horizon,takeshineshiro/horizon,yeming233/horizon,orbitfp7/horizon,newrocknj/horizon,xme1226/horizon,wangxiangyu/horizon,ikargis/horizon_fod,Daniex/horizon,sandvine/horizon,openstack/horizon,eayunstack/horizon,mdavid/horizon,agileblaze/OpenStackTwoFactorAuthentication,redhat-cip/horizon,redhat-openstack/horizon,agileblaze/OpenStackTwoFactorAuthentication,saydulk/horizon,RudoCris/horizon,mandeepdhami/horizon,blueboxgroup/horizon,NeCTAR-RC/horizon,noironetworks/horizon,henaras/horizon,redhat-openstack/horizon,tsufiev/horizon,philoniare/horizon,CiscoSystems/horizon,Mirantis/mos-horizon,NCI-Cloud/horizon,Solinea/horizon,spring-week-topos/horizon-week,promptworks/horizon,Mirantis/mos-horizon,pranavtendolkr/horizon,saydulk/horizon,django-leonardo/horizon,noironetworks/horizon,aaronorosen/horizon-congress,tqtran7/horizon,yjxtogo/horizon,CiscoSystems/avos,zouyapeng/horizon,BiznetGIO/horizon,anthonydillon/horizon,dan1/horizon-proto,pranavtendolkr/horizon,ChameleonCloud/horizon,davidcusatis/horizon,mrunge/horizon_lib,ChameleonCloud/horizon,karthik-suresh/horizon,icloudrnd/automation_tools,dan1/horizon-x509,ikargis/horizon_fod,karthik-suresh/horizon,dan1/horizon-proto,JioCloud/horizon,Daniex/horizon,gerrive/horizon,Dark-Hacker/horizon,endorphinl/horizon,dan1/horizon-x509,vladryk/horizon,watonyweng/horizon,mrunge/openstack_horizon,saydulk/horizon,ChameleonCloud/horizon,maestro-hybrid-cloud/horizon,orbitfp7/horizon,mdavid/horizon,zouyapeng/horizon,henaras/horizon,nvoron23/avos,yjxtogo/horizon,Daniex/horizon,coreycb/horizon,tqtran7/horizon,orbitfp7/horizon,Hodorable/0602,Metaswitch/horizon,eayunstack/horizon,liyitest/rr,ging/horizon,mdavid/horizon,CiscoSystems/avos,newrocknj/horizon,liyitest/rr,coreycb/horizon,kfox1111/horizon,anthonydillon/horizon,Hodorable/0602,coreycb/horizon,NeCTAR-RC/horizon,Daniex/horizon,NCI-Cloud/horizon,gochist/horizon,spring-week-topos/horizon-week,sandvine/horizon,blueboxgroup/horizon,RudoCris/horizon,tellesnobrega/horizon,RudoCris/horizon,agileblaze/OpenStackTwoFactorAuthentication,Dark-Hacker/horizon,Solinea/horizon,henaras/horizon,ging/horizon,bigswitch/horizon,kfox1111/horizon,flochaz/horizon,mrunge/horizon,icloudrnd/automation_tools,froyobin/horizon,aaronorosen/horizon-congress,FNST-OpenStack/horizon,bac/horizon,gerrive/horizon,karthik-suresh/horizon,endorphinl/horizon-fork,redhat-cip/horizon,gerrive/horizon,kfox1111/horizon,tellesnobrega/horizon,tellesnobrega/horizon,watonyweng/horizon,Mirantis/mos-horizon,flochaz/horizon,maestro-hybrid-cloud/horizon,endorphinl/horizon,izadorozhna/dashboard_integration_tests,mrunge/horizon_lib,froyobin/horizon,aaronorosen/horizon-congress,anthonydillon/horizon,openstack/horizon,kfox1111/horizon,idjaw/horizon,VaneCloud/horizon,FNST-OpenStack/horizon,anthonydillon/horizon,tqtran7/horizon,luhanhan/horizon,endorphinl/horizon,bigswitch/horizon,endorphinl/horizon,yjxtogo/horizon,blueboxgroup/horizon,luhanhan/horizon,endorphinl/horizon-fork,redhat-openstack/horizon,django-leonardo/horizon,openstack/horizon,saydulk/horizon,Tesora/tesora-horizon,CiscoSystems/avos,davidcusatis/horizon,tanglei528/horizon,wolverineav/horizon,BiznetGIO/horizon,xinwu/horizon,doug-fish/horizon,takeshineshiro/horizon,spring-week-topos/horizon-week,dan1/horizon-x509,Mirantis/mos-horizon,icloudrnd/automation_tools,BiznetGIO/horizon,Solinea/horizon,luhanhan/horizon,philoniare/horizon,tsufiev/horizon,yanheven/console,wolverineav/horizon,yanheven/console,xinwu/horizon,tellesnobrega/horizon,VaneCloud/horizon,Hodorable/0602,newrocknj/horizon,froyobin/horizon,doug-fish/horizon,mrunge/horizon,eayunstack/horizon,tanglei528/horizon,bac/horizon,endorphinl/horizon-fork,idjaw/horizon,RudoCris/horizon,flochaz/horizon,pranavtendolkr/horizon,vladryk/horizon,promptworks/horizon,ChameleonCloud/horizon,j4/horizon,mandeepdhami/horizon,noironetworks/horizon,NeCTAR-RC/horizon,Dark-Hacker/horizon,liyitest/rr,newrocknj/horizon,mrunge/openstack_horizon,CiscoSystems/horizon,takeshineshiro/horizon,gochist/horizon,xme1226/horizon,philoniare/horizon