Rangers stormed 14 points clear at the top of the Scottish League One table after a thrilling 3-1 victory over Dunfermline at Ibrox.