Change to the correct way of querying the DB
Did a big cleanup and added comments to all functions
Merged my new commits
getLiterals() is now working as intended