Added new tests and refactored some old stuff to throw exceptions instead of returning plain strings.