Kill duplicate processes.

This application now will kill duplicate processes, so that the most
recent process is unique. This allows the application to be run again by
the user to refresh the hook.

Also general code cleanup/comments.