Refactorintg code, adopting to beta4 syntax and developing new swift functions to help with dictionaries. This commit will not compile.