utils: new Memoise

* Changes old method of checking 'hashability' into a correct one.

* Removes unnecesary duplicated memoize.

* Adds InstanceMethodMemoise for memoising instance methods.

Signed-off-by: Mateusz Susik <mateuszsusik@gmail.com>
You should not add empty lines around docstring in method/function.
Can you also use `"""` instead of `'''`: `"""Return the function's docstring."""`
Thanks