Electron spin dynamics in quantum dots and related nanostructures due to hyperfine interaction with nuclei