Merges changes from SVN as of 19th of December, 2014

I have tested the changes, and everything seems to be in order, except I have added one fallback to the old code to avoid a fatal error.
@lancewillett @justinshreve @blowery @enejb @jkudish @aduth can you please see if all the code here is as intended? Thanks!