Implement AJAX preview on frontend-rewrite.

Change-Id: I5ed43ea3c7a5be653356f818fbee3053fee34f89