Refactor indent generator and clean up serialization modules