First principles molecular dynamics study of liquid and amorphous silicon