Added WITH_DEPRECATED option, #983
Updated unit tests to new syntax, #983