Improved JS library a little bit

Now the append and prepend methods work fine.