Final Syncing work

Hopefully browser syncing should work. The code is dirty for now but
hopefully thats ok.