Cleanup permalink generation

Fix permalink generation to not contain various smells. See verbose description in the last commit in this PR.
Instead of using `@options` to store state, I would suggest "unwrapping" the `@options` in `#initialize` and then use `attr_reader :length`.