Massive refactor and relocation; more to come
Fixed several bugs including failure to record option selection