Moved autoSort and autoDeposit logic to Bags.lua.

Also, do not sort when there is no need to do so.