Refactored js folders so they will load in the appropriate order
Determine context root at runtime
Handle 401 ajax errors by redirecting to login with redirect url