Reorganize code into submodules, separating the command-line tool from the library. Eggify. Closes #1.

Use the console_scripts entrypoint instead of just `scripts` so we have a chance of someday working on Windows.