Formatting Output Javascript Array Of Functions