Deprecated transaction.is_managed().

It's synchronized with the autocommit flag.
Moved standard SQL for savepoints in the base backend.

These methods are only called when uses_savepoints = True anyway.
Refactored implementation of savepoints.

Prepared for using savepoints within transactions in autocommit mode.
Added support for savepoints in SQLite.

Technically speaking they aren't usable yet.
Implemented an 'atomic' decorator and context manager.

Currently it only works in autocommit mode.

Based on @xact by Christophe Pettus.
Made atomic usable inside the legacy transaction management.
Added some assertions to enforce the atomicity of atomic.
Deprecated the old transaction management APIs.
Removed superfluous code now that connections use autocommit by default.
Made atomic work even before the first SQL query.

Thanks Florian for reporting this bug.
Made transaction management work even before the first SQL query.

Thanks Florian again.
Documented how atomic behaves in managed mode.

Thanks Florian once again.
Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED.

Replaced them with per-database options, for proper multi-db support.

Also toned down the recommendation to tie transactions to HTTP requests.
Thanks Jeremy for sharing his experience.
Implemented atomic_if_autocommit.

This cannot be used right now, but it'll be useful in 1.8.