Lots of change. See README for full list. After security is complete and the code is commented, will merge with master.