larsmans refactor linearoperator

rebased and should pass tests