Clean up mriview.js, prepare for new code