Updated refactored version by enyo

I added support for sets, fixed breaking changes, and started working on the serializer.

I plan to implement all the missing features in the coming month or so.

I just noticed the master is still being maintained, it would maybe be better to combine efforts, since this version is so radically different :)