Electron beam manipulations at the angstrom level and attosecond timescale for X-ray FELs