Fixing function ordering for AMD loading

For Asynchronous (AMD) loaders like Kickstrap, the fact that the jquery plugin code references functions written later in the code causes the functions to fail. Simply moving those references before the jquery code fixes this.