Refactor the JavaScript styleguide

So that it is clearer how to to add things in the future refactor the
current guide.