So if a church (of any kind) decides to go out of business and sell all their assets who gets the money?
It depends on the church and who they are affiliated with. With many it would revert back to the headquarters of the denomination.
If it's an unaffiliated church, likely back to those who attended or those who initially put the money up to start it. Most would have a document that would define what was to happen.