Reworked, added a test class, and fixed priority and context lookups.

Changed to a Portable Class Library project to support desktop, win8,
and Windows Phone 8.