Added support for page refreshing and clean URLs

Fix for issue 4.