Removed redundant code

Added private helpers that hold the code shared between add- and append- functions in order to remove redundancy.

addBy-/appendBy- -Names, -StringIndices, -Indices, and -Prefix were edited.