Two-dimensional materials for energy storage and generation