404 page: simplified base url-path calculation and moved it to OcSmarty class, so that it is universally available
updates #246