Moved spinner out of $(document).ready to make the loading screen appear as early as possible.