Cleaned up and optimized SQL (added indexes).
Fixed directory tree, and cleaned up some code.
Fixed some plugin search paths.
File export now saves last used path for next time.