You want to look into HyperSwitch and SizeUp. These two solve pretty much all headaches relating to window management on macOS.