Add unit tests + Fix bugs found through tests

This covers all JSON de/serialization logic and block manager
reporting blocks with updated storage statuses during put.