Fix @spec sort_by

Use format provided by José Valim that uses `when` to eliminate the need
for `@type mapped_element`.
Fix spacing
Pull reused test data into variable
Fix phrasing of Enum.sort_by/3 @doc