Statistical mechanics of a bounded, ideal magnetofluid