Silicon-based surface gratings for efficient fiber-chip and free-space beam coupling