Revamp plugin JS setup extension to not rely on <script> tags (#547)
Fix tests broken by plugin work (#547)