extract metadata merge into a function
Move address discovery code into its own file
function reordering and variable renaming
discover.js -> network.js, move transaction fetch function into it