Major update, mostly working now.