Add jQuery to support HTTP basic auth.
Arrange code.
Simple way to detect if file exists.