Extract helper to ease testing form posting
Rename extractReferer() and add test for it