Joint Density-Functional Theory And Its Application To Systems In Solution