Changes from sf-te

This rebases sf-te to current master. Seems to be running fine on te.

The one open thing here is the sf-te branch on travis-support. I see two strategies:

* Work on merging travis-support/sf-te first. Since all apps depend on this it would either mean to use a backup (old-master) branch on other apps, or merging everything in a hurry.
* Merge apps one by one, switching them over to use travis-support/sf-te meanwhile. Once all apps are merged (and tested) merge travis-support/sf-te.