Converted class to pure JavaScript. Thanks vincentpiel.