created new files misc_tools.(c|h) and moved hex_string_to_bin() there.

function hex_string_to_bin() was defined at least 5 times in different files! I created a new file misc_tools for random things like this function, so we wont have to duplicate code.