Pushed to upstream

cc/ @rotty3000.  Tests fixed. Please see here where regressions were introduced: http://ci.liferay.org.es/jenkins/job/liferay-portal-master/2391/changes/