Fixes #62, SQL reference issue; closes #61, cleanup/CLI command