MNT: Overhaul of 2D -> 1D and added tests for it

- renamed function
- added test coverage for it
- fixed some PEP8 violations