SConstruct cleanup
- Use Substfile instead of hand written code
- Add more error checks, and dependencies
Merge pull request #1339 from markbenvenuto/scons_cleanup

SConstruct cleanup