Move bitcoin serialization code from main.c to new file 'serialization.c'