Refactor slug module and add documentation