Big rewrite

Moved all functionality to its own PHP class.
Some better error handling & feedback.
Browse can now launch files.
Fixed some other things that didn’t work for me.