[Philip] Refactor out btc_utils.js