Many various updates to polish up the code a bit and to finish most TODOS except for debugging, and for various logic issues, quality smells etc.