Added toObject transformation option. Updated documentation.