Adding coin control support.

Thanks to cozz for the original bitcoin patch
https://bitcointalk.org/index.php?topic=144331.0