Added the SConstruct file (finally), and a bunch of misc fixes.