Don't store garbage in the history and strip \r
Added tests for site modes