Fix sitetreeload management command for python3 and Django 1.7

The sitetreeload management command was not working for python3, or for python2.7 with Django 1.7.

3 issues are fixed here:
 1.  python3 support: replace builtin file() with open()
 2. deprecated transaction management methods ignored for Django 1.7+
  - transaction.commit_unless_managed
  - transaction.managed
 3. use renamed router migration method in Django 1.7