Improve splitting of settings

- Common vars that don't need any change are in __init__.py
- Vars that are usually different in production/development, but usually don't
need further touching are splitted in production.py and development.py.sample
(since development environments might differ, a sample file created instead of a
 version controlled one)
- Vars that have no default values are in local_settings.py.sample
Update includes based on the django 1.5 restructure
django.conf.urls.defaults deprecated, replace with django.conf.urls
Move log_extra_data to separate file, and improve the code based on the changes
in the settings LOGGING dict
Use a better implementation for encrypt/decrypt password
Rename the file with the exceptions (currently has only one, more will come)
Rename libraries/ to common/
Change the imports accordingly to the previous renames
sha_password renamed to sha1_password, change calls accordingly
typo
Bring back the random_string function