Split sqlalchemy_acj into database and models.

This appears to be the recommended setup from the Flask sqlalchemy page,
where the database connection and session is established in a different
module from the model definitions.
New database structure done.

This is basically a new database. Going to slowly adapt the rest of the
code base to it. Eliminated a lot of tables for simplification.
Refactor login front-end to Angular modules.

Not really sure where I'm going with this, but this is continuing the
movement to Angular modules.
Add ability to load settings from environment

Also fixed the loading Image package from Pillow
Add idea project files to gitignore
Add requirements.txt for dependency management
Implement new authentication system.

Information on the logged in user is stored using AngularJS's
$cookieStore module.

The old authentication system was a bit scattered, this refactor tries
to bring some more organization to it. Authentication's event broadcasts
and cookie management is now concentrated in an AuthenticationService.
Login/logout event names are now AuthenticationService constants. User
login/logout event broadcasts automatically happen as
AuthenticationService is modified.

User login verification and validation has now been moved to the login
module. The remaining login/logout code in acj-controllers should be
removed except that they seem to be used in a lot of places, so have to
remove all references to them before removing.

On the API side, a successful login will return the user's id. The login
controller has to retrieve additional information on the user using the
UserResource.

Still haven't decided how to do logout, but that should be next.
Change the resources name to lowercase
Autoformat models.py

Just changes made by the autoformatter.
Refactor top navbar, implement logout.

The top navbar needed to be refactored for the new login system. It now
uses the AuthenticationService to check user login information.

The IndexController has been renamed NavbarController and is now in its
own module.

Removed tutorial button from the top navbar. I think the whole tutorial
option should be triggered on individual module pages, instead of being
in the navbar. This should make it easier to implement, as we don't have
to worry about communication between different controllers now.

The login module now has a logout controller. The logout controller is
only used for the logout option in the top navbar's user dropdown. Not
sure if this is the best organizational arrangement, but it'll have to
do.

The navbar is now 100% stretched across the browser instead of being
confined to the rest of the container. It should be fluid now and should
shrink to a collapsible button on small screens.
Add relationship to User and Course model
Change CSS to Less compilation.

Since bootstrap uses Less and it'd be nice to customize some of
bootstrap's colors later on, might as well switch now. Also,
AngularStrap had some required CSS in Less syntax.
Login now shows as a modal popup.

On auth failure, the user is redirected to the login page. This means
that the user loses all the context of the page they were on.
Http-auth-interceptor suggests that no redirection is performed on the
page in order for it's failed request replay to work properly.
Implementing the login as a modal allows us to ask the user for
authentication without losing the context of where they were before
going to the login page. The modal shows up as an overlay, the user
enters their information, the failed requests are automatically
repeated, and the user should see everything resume seamlessly.

This means that only pages that need to make authenticated requests will
see the login popup. So if we need to make pages that don't need
authentication, all we need to do is make sure no authentication
requried requests are made on that page.

The http-auth-interceptor library was updated to 1.2.1 in this commit.
Fix autofocus for login form.

The switch to modal for the login form broke auto focus on the Username
input. Looks like the HTML5 attribute autofocus doesn't work either.
Both problems seems to be caused by not waiting for the input to render
before setting focus.

Using a $timeout looks like is the standard way for forcing a wait for
render, that seems to fix the auto focus directive.

Since the auto focus directive seems to be only used in the login form,
I've moved it into the login module. If it's used elsewhere, then we'll
need to look at putting it somewhere that makes more sense.
Fix gravator hash and add tests
Home page refactor.

The home page was moved from coursepage to the Angular module "home".

Also tried to get Flask-Restless to play well with not exposing the
user's password hash. Unfortunately, all the different ways of excluding
fields or only including fields seem to fail when doing queries on
relations (e.g.: /users/1/courses). The password hash is hidden on
normal users queries but when you ask for something like a user's
courses, it pops back up. This means that we might have to abandon
Flask-Restless.
Switch authorization lib from principal to bouncer

Now using Flask-Bouncer for authorization rather than Flask-Principal.
The revamped scheme I came up with for authorization in Flask-Principal
turns out to be very similar to how Flask-Bouncer is structured (e.g.:
action name such as READ, a model name, and a model id to identify a
permission). So it was easier to just use Flask-Bouncer.

Note that two libraries are both problematic in that there seems to be
no easy way to make them work in blueprints and has to live in the main
app module.

Permissions are defined in the new authorization.py module in a
function. The function is called by the app module during bouncer's
setup.

The Users object now tracks last seen based on last login and last
logout. Note that these are probably insufficient since the time between
login and logout may be quite a while.

Don't feel like going through the Users module's old code to see what
can still be used yet, so I've just commented them out for now.

Note, also abandoned using Flask-Restless for the Users model. To
properly control hiding the password hash, I'm using Flask-Restless's
helper methods to generate the JSON manually instead of the automatic
setup.
Course API updated, new add course page.

The Course API is now switched to the Flask-Restless assisted module.
Moved the to_dict() function out of User to Util, since it's now also
used by Course. There is now a pagination variant called
to_dict_paginated(). In addition to doing the actual pagination, it also
fills in the fields necessary for pagination support on the client side.

Adding a new course is now in it's own page instead of being on the home
page. It now lives in the course module. We should be able to achieve
the same effect of not leaving the home page by putting it in a modal
like the login. There's problems with the login modal though where the
home page doesn't update after a login, need to solve that first.

While permissions on the server side is nicely handled by Flask-Bouncer,
there's no equivalent on the client side. This will need to be addressed.
Refactor how the app is being setup

Added manage script to streamline the application management,
including running the app and managing database.

Switched to Flask-SQLAlchemy as it provides lazy initializing
the connection of the database. models.py was updated.

Application configuration was refactored and introduced configuration
module to load the configuration from multiple places.

Updated requirements.txt to reflect the new dependencies.

Added .travis.yaml for CI testing
Fix 'DATABASE' key in config, organize __init__

Just group plugin initializations together in __init__.py