RF + TST: More work on matlab => notebook.

Including some basic tests.