astakos: Add logic functions, split im.functions

Add a `user_logic` file that serves as a common endpoint for actions on
users. The actions that this file offers act as a wrapper above
`activation_backends` and are currently used by `snf-manage`. This file
also offers a `validate_user_action` function that checks if an action
can be applied on an AstakosUser.

Also, add a `validate_project_action` function that takes a project and
an action as arguments and checks if the action can be applied on the
project.

Moreover, split `im/functions.py` in two parts. Rename the first part as
`user_utils.py` and keep in it all user-related utilities that
`im/functions.py` provided (mainly mail utilities). The second part is
the project-related functions, which will be kept in `im/functions.py`
for now.

Finally, add the `send_plain` function in `im/user_utils.py`. With the
`send_plain` function, the admin can send a fully customizable mail to
an AstakosUser. The admin can either choose to use the provided body
template (`plain_email.txt`) and subject, or write his/her own.
astakos: Fix imports

Due to the split of `im/functions.py`, we need to import the functions
that were transfered to `user_utils.py` from the correct file.
astakos: Add tests for user_logic

Add tests under `im` that verify that the functions in `user_logic.py`
are working as intended.