Clean up and reorganize all the build optimizations

1)Remove all redundant flags
2)Move all device optimizations to the build repo
3)Clean up all unneeded code