Big refactor

Hi Ryota,

I changed the class to avoid the _connect() and _close() call for every method called.

Also I translated your comments to english, reformatted some code, did some more documenting, corrected a typo in the Exception classname and fixed docblocks.