strip trailing baseurl slash. Added a new template function "sanitizeurl" which ensures no double slashes. Fixed #221