Made a specific keyspace/dictionary definition
Split business code from demo form
Made everything OO and improved commenting