ENH: add new Warning class, improve tests, update docs