Finished code refactor into separate files

Also, added study GET allIds. See documentation on the Study endpoint
for details.