Change license to BSD 3-Clause License

Change license of all files from the GNU Affero General Public License
to the BSD 3-clause license.
Improve Python-3 compatibility

* Syntax :

  + Print function, not statement

  + Raise syntax

  + Except syntax

* Iterator changes

* unicode vs. str