Added main (config) window

& glued most of the pieces together
& fixed several bugs (and made dozens more)