BIP-146 Add path normalization logic from bootstrap.js