Moved logic functions from detail into logic namespace
Simplified serializer a bit