Add serializer for AbstractMessage

+ Set compiler optimization flag to 0 -> easier for debugging