Add magellan custom JS edits and clean up other JS