Psychology and Epistemology: Towards a Theory of Knowledge