COMPLETE REVISED Initial

First commit for the complete revision. Bug fixes and changes will come
after this.