graphics update, code tweaks to enable referer tests.
start functional rewrite