Electronic structure, phase stability, and chemical bonding in Th2Al and Th2AlH4