Mechanism and control of periodic surface nanostructure formation with femtosecond laser pulses