fix readme, make errors extend Error, make unnecessary public constant private and update associated unit tests