Restructure parser exceptions

Closes #4