some stupidity fixes; make selected a property; remove locals() which was stupid; don't save internals as json