Architecture cleanup, lots more testing and functionality