Nested module declarations in permalinks.rb

- having them all on one line was sometimes
  causing NameErrors on load