This reinstates commit efda2831 without the tests and with fixes for 32 bit x86 builds. Change-Id: I34be4fe1e8a67686d26ba256fd7efe0eb6a569e8