Refactoring/cleanup of filesystem ajax.