Added closeAccount, isAccountClosed, and query functions