Pending PR merge

Merged the following pull requests from peercoin repository:
https://github.com/ppcoin/ppcoin/pull/23 with some fixes
https://github.com/ppcoin/ppcoin/pull/33
https://github.com/ppcoin/ppcoin/pull/35
https://github.com/ppcoin/ppcoin/pull/42
https://github.com/ppcoin/ppcoin/pull/51
https://github.com/ppcoin/ppcoin/pull/54
https://github.com/ppcoin/ppcoin/pull/55