Switch to 2-space indents
compile: Guard main() with test for BASH_SOURCE

Also add guard to test scripts.