Merge "Rework bit-copying functions and re-enable tests"