Added priority annotation. Added further javadoc and tests.