Quantum control and entanglement of nanomechanical oscillators