Move database logic into a different file.
Improving error vectors on philarios methods.
Adding tests for target vectors.