Wrap frontend scripts in document.ready