Added TEMPLATE_DIR var.
Added abs path for page resources (see get_base_url function).