Move code inside __main__ block.

Having code out of the __main__ block makes it run when the file is
loaded as a library, which interferes with most testing frameworks.

This was causing unexpected errors while using py.test.
Merge branch 'master' into generic-directives

Conflicts:
	naginator.py
Minimal tests added for get_*_config() functions.

Function get_nagios_data() is mocked; no connections to PuppetDB for
running tests.

Requirements to run tests: py.test and mock.
Sort alphabetically directives in templates.
get_hosts_config(): use one template for all types.
get_contact_config(): use one template for all types.
get_contactgroup_config(): use one template for all types.
get_hostextinfo_config(): use one template for all types.
get_service_config(): use one template for all types.
Rename methods for readability. No functional changes.
Rename methods for readability. Fixed typos.
Show tip if 'import jinja2' fails.
Remove unused get_<dtyp>_config() functions.
Merge pull request #4 from funollet/generic-directives

Generic directives