serializer: fix & improve indentation

* fix indentation
* remove useless indentation modes
* make possible to specify the number of white spaces to use