fixed some code style, fixed legendtoc, removed moment.js as not used yet