Add browser sync, fix some bugs