Fix indents

Sorry for breaking all diffs, but the entire file had to be reindented
to regular python standards.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add more tests

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add some documentation strings

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add error messages and test for invalid modules

The invalid module tests raise a question on API consistency: test_module
returns true or false, but load_module throws an exception. TODO: review
API return values and see if we can improve them somehow.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Use constant to check for error

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix play_buffer implementation and add callback example

Add callback example to exercise play_buffer. This method must return
both the data buffer and an module end signaling. Sometimes a callback
passes the buffer to be filled so it's good to have it passed as a
parameter, so we return a boolean to tell if we're finished. Also
create a static method buffer() to create the buffer in a format
appropriate for play_buffer().

TODO: check if this call format makes sense. I'm not completely happy
      with it, perhaps there's a better way.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>