fix prepared statements in batch requests

This patch contains the following:

1. Fix detection of prepared statements in batch requests - both the statement and query_id are instances of `basestring` so detection with `isinstance()` failed. Now `prepared` is explicitly stored when the statement is added.
2. Finish prepared statement serialization
3. Fix `BatchStatement.__str__()`