Compressed HTMLElement#afterPut() and #prependWith()

Made a single function that can create the intended function given the correct configuration parameters.
Compressed the document sorting functions

Now reusing a variable and optimized the return statement (minifier wasn't minifying optimally).