Add attribution and fix pep-8 issue
Move Marker callback encoding to separate method

Use marker.get_encoded_callbacks instead of to_dict

marker.to_dict was only used to get the encoded callbacks.
Improve documentation