Add set_value_in_memory method
Extend tests
Reformat and simplify code

Use set_value_in_memory function and overloaded operators
Delete debug printing