Added support for files and a ui.

Also did more rigorous testing.