Refactoring of controller

Keys of URLS constant now match their value
Added permalink and redirect_url keys
Setup stats page for display of data, else redirects
Refactoring to pass data to views in a hash