Fix: tests: guessed Notification id could be another value if others tests files were previously run in the same session/process.

If you run this test with others in the same process,
like with: "nosetests -xv test_no_host_template.py test_notification_master.py",
then Notification.id may be != 12 ! (why not 42 ? :p)

Just mock Notification.__init__ (the only one we are interested here) and retain the newly created instances in a list.
The one we'll need should be the first (guessed_notif).
"original" stdout can even miss an encoding attribute.

If run "externally" then sys.stdout could be a StringIO for instance,
and have not an encoding attribute.

safe_print: enh: If UnicodeError problem on write then still fallback on 'ascii' as last possibility.

also use getdefaultencoding for guess encoding.
Enh: make Scheduler a newstyle class.

- To be consistant.
- Used for test debug:
  dynamicaly changed the "action" attribute to a property so
  to trace its usage from the tests.
clean tests: imports of test/shinken_modules.py

Workaround: for livestatus test: it badly import things imported here, instead of importing them directly.
Workaround : livestatus import datetime from here instead of directly.
Workaround : livestatus "sub-"import time_hacker from here instead of directly.
Workaround : livestatus "sub-"import sys from here instead of directly.
Allow to give REGEXPCMD as 6th arg of new_runtest.
Try travis with stdout buffered.

Still need process-restartworker and processes.
because of too much memory usage by the tests.
.. and process-timeout too
Merge pull request #1378 from gst/fix_misc_tests_problems

Fix misc tests problems
Included importlib for python2.6.
Py26: Still try to load importlib from system before fall back on our copied one.
Why not (re-?)enable travis for 2.6 while we are at it ?