Refactored and first test code

two classes: Spectrum and Map.