Spin Glass Theory And Beyond: An Introduction To The Replica Method And Its Applications