cleaned upo oskari.js with new features with less linesofcode