Fixed following cases:
*Slug would not generate when post title was empty
*Slug would generate incorrectly if, after explicityly editing slug, the post was saved before hitting ok on the slug
Also cleaned up comments, fixed code, and made this at least a somewhat sensical commit.