Handle titles containing @ in JS

Correctly handle titles containing @ on the local site. Also fixed issue
where the site field wasn't correctly cleared after adding a page.

Change-Id: I8733e09aea661625bcb8d5716e5d496d605d1e52