Add OrderedDefaultDict

Grabbed from: http://stackoverflow.com/questions/4126348/how-do-i-rewrite-this-function-to-implement-ordereddict/4127426#4127426
Add OrderedMemoryStore

This ensures that RDF entries are retrieved in the same order that they are inserted.
Changed all dictionaries to ordered dictionaries