Simple sprintf implementation in js.