Pure JavaScript phone formatter