Javascript string extension for formatted strings