Port bug 1000994 and bug 1036525 to comm-central, r=build-system port by build peer

--HG--
extra : rebase_source : f336c3621f4cfbc4bd97cfb808c90bec0daa8f68
Bug 1037479 - Move LOCAL_INCLUDES to moz.build, r=Standard8

--HG--
extra : rebase_source : 61e52448b0217eb9a54ca436f5d665969991d3b0
Bug 1037482 - Move TESTING_JS_MODULES to moz.build, r=Standard8

--HG--
extra : rebase_source : 5766d32abcb274e3075b07a314647e6418749e3a