Scanning Probe Studies of Structural and Functional Properties of Ferroelectric Domains and Domain Walls