more work on bitswap and other code cleanup
bitswap first working commit!