Add perpetual code

@mortenvp @janusheide I will try to update this branch with the master. We should release perpetual NC soon.
Also feel free to add comments to the unit tests, in particular when multiple things are being tested.. so in here is a test for the all zeros vector. But you have to read the code to find it.. Would be nice if you could quickly spot it. Either by putting it in it's own test or highlighting with a comment that this is where it is tested.