Added Context object to api. Uses shared state instead of singleton pattern
Added context tests
merged head