added BVP constructor with tests. Separated some code into separate files.