Twinning hierarchy, shape memory, and superelasticity demonstrated by molecular dynamics