ifdef out hlib dependent code
Only try to include hlib in driver building if we have it
Move hlib energy tests so that they are recognised as needing hlib
Simplify getcwd so that it works on my laptop

Not really sure why I had to do this, possibly something to do with
hlib's includes.