Added Repositories and added hibernate stuff

Also switched notes id generation. THIS BROKE IT. REQUIRED DB
REGENERATION. DO NOT DO OFTEN.