cleanup of JS, getting closer to working playlist support