Make the build more IDEA friendly

With these changes you should be able to run the embedded smoke tests even after an IDEA rebuild.