Cleanup: code folds, variables; closes nima/site#21

Cleaned up the code presentation and folds, and changed all global
variables to force-check themselves; for example `${GLOBAL_VAR?}'.