Separate www methods from routes; add tests