Refactors sidebox JavaScript, homepage only for now