clean. group hilbert_space tools

- group hilbert_space tools for later reuse.
- clean hamiltonian from sortedspace
- adapt one test (space_parition) for Os X.
- code cleaning