BUG: unstack fails in PeriodIndex
Closes #4342.

Also changed `Categorical` and `PeriodIndex.factorize` to make index sorted like other indexes do.

did anything change because of the sorting change?
 @sinhrks fyi, in general ping me when you think something is ready for merging (esp if its marked for 0.14). try to make green! if its not, ok to ping as well and will take a look
 Sorting change only affects to `Categorical` creation with `PeriodIndex`. Because:
- `Categorical` calls `Index.factorize` if it has the method. Currently, `PeriodIndex` is the only class which has the method. Thus, any other classes and indexes are not affected.
- `PeriodIndex.factorize` use `sort=False` as default (which derived from `core.algorithms.factorize`). Thus, any other function which use `PeriodIndex.factorize` will get the same result as before.
 ok; looking at this code, I think you can  define `factorize` for `Index/Series` in core/base.py,

then just do the test `hasattr(labels,'factorize')`
 ok, i think you can rebase this and then good?
 or close after #7090?
 Should be rebased, I will finish it soon.
 @jreback Rebased, and get green.
 thanks!
