Overhauled the append, prepend, after, before and html functions as they were failing on passed dom elements